<?php

namespace App\Modules\Admin\Http\Controllers\Apparatus;

use App\Modules\Admin\Http\Controllers\BaseController;
use App\Modules\Admin\Services\Equipment\EquipmentParamsService;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class EquipmentParamsController extends BaseController
{

    public function __construct(EquipmentParamsService $service)
    {
        $this->service = $service;
    }
    public function getSelectByEid(Request $request)
    {

        $result = $this->service->getSelectListByEid($request->all());
        return $this->successJson($result, $this->service->getError());
    }
    public function listParam(Request $request)
    {

        $result = $this->service->getSelectListByParams($request->all());
        return $this->successJson($result, $this->service->getError());
    }
    public function updateParam(Request $request)
    {

        $result = $this->service->updateParam($request->all());
        if ($result) {
            return $this->successJson($result, $this->service->getError());
        }else{
            return $this->errorJson($this->service->getError());
        }
    }
}
